import Config from '../../config';

var WH_Constants = {
  TAG:{
    JDZ: {key:"JDZ", name:"金点子", tag:1, icon:'thumb-up'},
    TOP10: {key:"TOP10", name:"本月TOP10", icon:require("../../../resource/images/workhard/bang.png")},
    CYS: {key:"CYS", name:"倡议书", tag:2, icon:require("../../../resource/images/workhard/book.png")},
    WXTW: {key:"WYZP", name:"典型风采", tag:3, icon:require("../../../resource/images/workhard/tuwen.png")},
    JDZBUN: {key:"JDZBUN", name:"金点子", tag:4, icon:require("../../../resource/images/workhard/jindianzi.png")},
    YTBUN: {key:"YTBUN", name:"油田工匠", tag:5, icon:require("../../../resource/images/workhard/youtian.png")},
  },

  SUB_TAG: [{key:1, value:"原油开发"},
                    {key:2, value:"天然气开发"},
                    {key:3, value:"钻探工程"},
                    {key:4, value:"工程建设"},
                    {key:5, value:"机械制造"},
                    {key:6, value:"生产保障"},
                    {key:7, value:"石油化工"},
                    {key:8, value:"企业管理"},
                    {key:9, value:"安全环保"},
                    {key:10, value:"质量节能"},
                    {key:11, value:"科技创新"},
                    {key:12, value:"市场开发"},
                    {key:13, value:"人才培养"},
                    {key:14, value:"企业文化"},
                    {key:15, value:"党建工作"},
                    {key:16, value:"信息技术"},
                    {key:17, value:"矿区服务"},
                    {key:18, value:"生产经营"},
                    {key:19, value:"科技创新"},
                    {key:20, value:"管理提升"},
                    {key:21, value:"安全环保"},
                    {key:22, value:"党的建设"},
                    {key:23, value:"和谐矿产"},],
SUB_NEWTAG: [{key:18, value:"生产经营"},
                    {key:19, value:"科技创新"},
                    {key:20, value:"管理提升"},
                    {key:21, value:"安全环保"},
                    {key:22, value:"党的建设"},
                    {key:23, value:"和谐矿产"},],

  //根据tag来获得类型数据
  getTypeDataByTag(tag) {
    var name = ""
    switch (tag) {
      case this.TAG.JDZ.tag:
        name = this.TAG.JDZ.name;
        break;
      case this.TAG.WXTW.tag:
        name = this.TAG.WXTW.name;
        break;
      default:
        name = this.TAG.JDZ.name;
    }
    return name;
  },

  getTagByPageData(pageData) {
    var tag = 0;
    switch (pageData.key) {
      case Config.pages.wh_type_jdz.key:
        tag = this.TAG.JDZ.tag;
        break;
      case Config.pages.wh_type_wxtw.key:
        tag = this.TAG.WXTW.tag;
        break;
    }
    return tag;
  },

  getTypeDataBySubTag(tag) {
    for (var i = 0; i < this.SUB_TAG.length; i++) {
      if(this.SUB_TAG[i].key === tag) {
        return this.SUB_TAG[i].value;
      }
    }
    return "未知类型";
  },
}

module.exports = WH_Constants;
